home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / graphic / hpglvu10.zip / HPGLVIEW.DOC < prev    next >
Text File  |  1991-04-22  |  8KB  |  212 lines

  1.           HPGLVIEW - A Screen Previewer for HPGL Plot files
  2.  
  3.                 Copyright (C) 1991 Giovanni S. Moretti
  4.  
  5. HPGLVIEW will display the contents of an HPGL file, normally intended for a
  6. plotter, on the PC's screen.  The screen is treated as an A3 or A4 page and
  7. aspect ratio effects are ignored to maximise the available resolution.
  8.  
  9. Its designed to show you what the plot looks like on the page or what's in
  10. an HPGL file that you've just found, not be an absolute mimic of a plot.
  11. If you need absolute precision, plot it.
  12.  
  13.  
  14. LICENCING
  15.  
  16.     This program is free software; you can redistribute it and/or modify
  17.     it under the terms of the GNU General Public License as published by
  18.     the Free Software Foundation; either version 1, or (at your option)
  19.     any later version.
  20.  
  21.     This program is distributed in the hope that it will be useful,
  22.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  23.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  24.     GNU General Public License for more details.
  25.  
  26.     You should have received a copy of the GNU General Public License
  27.     along with this program; if not, write to the Free Software
  28.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  29.  
  30. -----------------------------------------------------------------------------
  31.     Giovanni Moretti                    | EMAIL:  G.Moretti@massey.ac.nz
  32.     Computer Centre,  Massey University |
  33.     Palmerston North, New Zealand       |
  34. -----------------------------------------------------------------------------
  35.  
  36.  
  37. RUNNING THE PROGRAM
  38.  
  39.    HPGLVIEW  <filename> [/A3 | /A4 ] [/G graphics-driver graphics-mode ] [/D]
  40.  
  41.    Defaults: A4 page, Autoselect graphics driver, Ignore unknown HPGL commands
  42.  
  43.    Pressing the ESC key will abort any plot in progress.
  44.  
  45.  
  46. OPTIONS
  47.  
  48.     /A4  (default)   - display the plot as it would appear on an A4 page
  49.     /A3              - display the plot as it would appear on an A3 page
  50.     /H /? ?          - Display a brief help page and licencing conditions
  51.     /G driver# mode# - Use the indicated Graphics Driver and mode
  52.                        Normally autodetection will be used but if you need it
  53.                        here it is (eg EGA card with CGA monitor use "/G 1 0" )
  54.     /D               - Display unknown HPGL commands at end of plot.
  55.  
  56.  
  57. GRAPHICS DRIVERS AND (VALID MODES) - Try mode 0 if unsure.
  58. ----------------------------------
  59. CGA    : 1(0-4)  CGA     : 2(0-5)  EGA: 3(0-1)     EGA64: 4(0-1)  EGAmono: 5(3)
  60. IBM8514: 6(0)    HercMono: 7(0)    ATT400: 8(0-5)  VGA: 9(0-2)    PC3270: 10(0)
  61.  
  62.  
  63. RECOGNISED HPGL COMMANDS AND ACTION
  64. -----------------------------------
  65.  
  66.   CI radius;    PLOT a CIRCLE centred at current location.
  67.  
  68.  
  69.   DF;           Default - Reset various parameters to a known state. Turns
  70.                 scaling and symbol mode to OFF, text direction is horizontal.
  71.  
  72.  
  73.   DI run,rise;  Controls direction of displayed text.  The BGI Graphics Toolbox
  74.                 only supports horizontal and vertical text.
  75.         Also text can't be displayed upside down so it will be in
  76.                 approximately the right place but it may face the wrong way.
  77.  
  78.  
  79.   DR run,rise;  Direction - Relative; See DI
  80.  
  81.  
  82.   IN;           Initialise - Beeps and waits for you to press a key.
  83.                 Raises the Pen and resets the scaling points P1 and P2.
  84.                 Used to pause between parts of concatenated plot files.
  85.  
  86.  
  87.   IP [ P1x,P2x,P1y,P2y ] ;    - DEFINE/RESET SCALING POINTS
  88.                 Define the scaling points to be used by the SCALE instruction.
  89.                 If there are no arguments, use the default scaling points are
  90.                 use which are just a little inside the plot boundaries for the
  91.                 chosen page size.
  92.  
  93.  
  94.   LB String^C   Display the text "String".  Text size and direction will
  95.                 be that defined by previous SI/SR and DI/DR commands.
  96.                 Text is terminated with a CTRL/C.
  97.  
  98.  
  99.   PA x,y;       PLOT ABSOLUTE   Move to X,Y - drawing if Pen is down.
  100.   PD [x,y];     PEN DOWN        Pen down [ and move to X,Y - ie. DRAW ]
  101.   PU [x,y];     PEN UP          Pen up   [ and move to X,Y - ie. MOVE ]
  102.   PR x,y;       PLOT RELATIVE   Move treating X,Y as an Offset from
  103.                                 current position, drawing if pen is down.
  104.  
  105.                 X and Y may be in absolute plotter coordinates or in
  106.                 scaled units, depending on whether the SCALE command
  107.                 (SC) has been encountered.
  108.  
  109.  
  110.   SC [ Xmin,Xmax,Ymin,Ymax ] ; - ENABLE / RESET COORDINATE SCALING
  111.  
  112.                 All succeeding coordinates will be within the range Xmin - Xmax
  113.                 & Ymin - Ymax.  Scales these values to be displayed within the
  114.                 rectangle defined by the IP command or the default IP
  115.                 co-ordinates.
  116.  
  117.  
  118.   SI [width,height];   DEFINE TEXT SIZE [ or reset to the default size ]
  119.                        The size of all following text is to be
  120.                        WIDTH and HEIGHT centimetres.
  121.  
  122.  
  123.   SM character;        DEFINE THE SYMBOL CHARACTER.   At the conclusion of
  124.                        any of the PA, PR, PD commands, plot the symbol
  125.                        "character".
  126.  
  127.  
  128.   SP pen-no;           SELECT PEN.  Changes the plot colour if enough colours
  129.                        available.
  130.  
  131.  
  132.   SR width,height;     TEXT SIZE Relative [ or reset to default ]
  133.                        Text plot size expressed as a percentage of the scaling
  134.                        points.
  135.                             Text width  is width%  of P2x - P1x and
  136.                             Text Height is height% of P2y-P1y
  137.  
  138.  
  139.   VS speed;            VELOCITY SET (of pen) - parsed but ignored.
  140.  
  141.  
  142. DEFAULT SCALING POINTS in PLOTTER UNITS (0.025mm)
  143.  
  144.                            A4        A3
  145.                         -----     ------
  146.       P2x               10430      15580
  147.       P1x                 430        380
  148.       P2y                7400      10430
  149.       P1y                 200        430
  150.  
  151.  
  152. PHYSICAL LIMITS
  153.                            A4        A3
  154.                          -----     -----
  155.       X_plot_width_mm      270       399
  156.       Y_plot_height_mm     190       271
  157.       hard_clip_X        10870     15970   plotter units (0.025 mm)
  158.       hard_clip_Y         7600     10870   plotter units (0.025 mm)
  159.  
  160.  
  161.  
  162. AREAS THAT COULD BE IMPROVED
  163.  
  164. COMMAND PARSER
  165.  
  166. Currently the arguments handled are of the form of a two letter command
  167. followed by zero or more arguments, separated by commas/spaces and ending
  168. with a semicolon; (eg PD10,30; whereas the HPGL specification indicates
  169. that arbitrary pairs of co-ordinates can follow some commands.  This
  170. normally doesn't cause any problems as most packages use form
  171. "PD10,20;PD30,40;" rather than "PD10,20,30,40;"
  172.  
  173.  
  174. EXTRA COMMANDS
  175.  
  176. I've implemented only those commands that seem to be most used.  There are
  177. LOTS of others, but for me, this subset is sufficient.
  178.  
  179.  
  180. RANGE of ARGUMENTS
  181.  
  182. I've used integers for the arguments whereas LONGS should really be used.
  183. None of my test plots exceeded the integer range but "Officially ..."
  184. Fix: recompile changing INTEGERS to LONG - not done as it's probably slower.
  185.  
  186.  
  187. TO RECOMPILE "HPGLVIEW" WITH INTEGRAL GRAPHICS DRIVERS AND FONTS
  188.  
  189. Compile BGILINK as supplied with your version of Turbo Pascal (*), as detailed
  190. in the file BGILINK.PAS.  This will generate the necessary DRIVER.TPU and
  191. .OBJ files.  This need only every be done once, in order to convert the
  192. .BGI files to .OBJ files. Copy the files DRIVER.TPU and LITT.OBJ to the
  193. same directory as HPGLVIEW.PAS and SMALFONT.PAS.  Recompile HPGLVIEW.PAS,
  194. it will recompile SMALFONT.PAS (which has the SMALL scalable font)
  195. automatically and link everything together into one .EXE file.
  196.  
  197.  
  198. Please send me a copy of any major hacks/improvements so I can
  199. coordinate any new releases.
  200.  
  201.  
  202. (*) Turbo Pascal is a trademark of Borland International, Scotts Valley
  203.                       California.
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.